import axios from 'axios'
import store from '@/store/index.js'
import qs from 'qs'

// 创建 axios 实例
let instance = axios.create()

// 自定义封装 axios
const myaxios = {
	// 发送 get 请求
	get(url, params) {
		return instance({
			url,
			method: 'GET',
			headers: {
				"Authorization": "sfsdf"
			},
			params
		})
	},

	// 发送 post 请求
	post(url, params) {
		return instance({
			url,
			method: "POST",
			headers: {
				"Authorization": "sfsdf"
			},
			data: params
		})
	},

	// 发送 put 请求
	put(url, params) {
		return instance({
			url,
			method: "PUT",
			headers: {
				"content-type": 'application/json',
				"Authorization": "sfsdf"
			},
			data: params
		})
	}
}

export default myaxios